import * as THREE from "three";
import { OrbitControls } from "three/addons/controls/OrbitControls.js";

const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(
  75,
  window.innerWidth / window.innerHeight,
  0.1,
  1000
);
camera.position.z = 5;
scene.add(camera);
const geometry = new THREE.BoxGeometry(1, 1, 1);
const material = new THREE.MeshBasicMaterial({ color: 0xffff00 });
const box = new THREE.Mesh(geometry, material);
scene.add(box);
const renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);

const controls = new OrbitControls(camera, renderer.domElement);
const helper = new THREE.AxesHelper(5);
scene.add(helper);
function animate() {
  box.scale.set;
  box.position.x += 0.01;
  box.rotation.x += 0.01;
  if (box.position.x > 5) {
    box.position.x = 0;
  }
  renderer.render(scene, camera);
  requestAnimationFrame(animate);
}
animate();
